#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages
import os

# 读取README文件
def read_readme():
    with open("README.md", "r", encoding="utf-8") as fh:
        return fh.read()

# 读取requirements文件
def read_requirements():
    with open("requirements.txt", "r", encoding="utf-8") as fh:
        return [line.strip() for line in fh if line.strip() and not line.startswith("#")]

setup(
    name="mghydro",
    version="0.0.1",
    author="大连理工大学水资源与防洪研究所产学研联合团队 iHeadWater",
    author_email="contact@iheadwater.org",
    description="Fast watershed delineation for anywhere on Earth's surface using MERIT-Hydro data",
    long_description=read_readme(),
    long_description_content_type="text/markdown",
    url="https://gitcode.com/dlut-water/mghydro",
    project_urls={
        "Bug Reports": "https://gitcode.com/dlut-water/mghydro/issues",
        "Source": "https://gitcode.com/dlut-water/mghydro",
        "Documentation": "https://gitcode.com/dlut-water/mghydro/blob/main/README.md",
    },
    packages=find_packages(),
    classifiers=[
        "Development Status :: 4 - Beta",
        "Intended Audience :: Science/Research",
        "Topic :: Scientific/Engineering :: GIS",
        "Topic :: Scientific/Engineering :: Hydrology",
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.11",
        "Programming Language :: Python :: 3.12",
        "Operating System :: OS Independent",
    ],
    python_requires=">=3.11",
    install_requires=read_requirements(),
    extras_require={
        "dev": [
            "pytest>=6.0",
            "pytest-cov",
            "black",
            "flake8",
            "mypy",
        ],
        "docs": [
            "sphinx",
            "sphinx-rtd-theme",
        ],
    },
    entry_points={
        "console_scripts": [
            "mghydro-delineate=mghydro.core.standardized_delineate:main",
            "mghydro-batch=mghydro.tools.batch_delineate:main",
            "mghydro-direct=mghydro.tools.direct_delineate:main",
        ],
    },
    include_package_data=True,
    package_data={
        "mghydro": [
            "data/**/*",
            "doc/**/*",
        ],
    },
    zip_safe=False,
    keywords="watershed delineation hydrology GIS MERIT-Hydro",
)